<!-- LISTAGEM -->
<div ui-view="" class="ng-scope" ng-show="list"><!-- uiView:  -->
	<div ui-view="" class="ng-scope"><!-- uiView:  -->
		<div class="pageheader ng-scope">
		    <h1>Título</h1>
		    <div class="breadcrumb-wrapper hidden-xs">
				<span class="label">Você está aqui:</span>
				<ol class="breadcrumb">
		            <li ><a href="#/home">Home</a></li>
		            <li >Administradora</li>
		            <li >Financeiro</li>
		            <li >Cobrança</li>
		            <li class="active">Titulo - Pesquisa</li>
		            <!-- 
		            <li class="active">Blank Page</li>
		             -->
		        </ol>
			</div>
		</div>
		<div ui-view="" class="ng-scope"><!-- uiView:  -->
		    <section id="main-content" class="animated fadeInRight ng-scope">
				<div class="col-md-6" style="width: 100%">
		            <div class="panel panel-primary">
						<div class="panel-heading">
							<h3 class="panel-title">Pesquisa .: Filtros</h3>
							<div class="actions pull-right">
								<!-- <i data-fullscreen-widget="" class="fa fa-expand"></i>  -->
	 							<i data-widget-toggle="" class="fa fa-chevron-down"></i>
								<!-- <i data-widget-close="" class="fa fa-times"></i> -->
							</div>
						</div>
	                    <div class="panel-body" style="display: block;">
							<div class="panel-body">
		                        <form class="form-horizontal ng-pristine ng-valid" role="form">
									<div class="form-group">
										<label for="inputNomeCondominio" class="col-sm-2 control-label" style="padding-right: 0px;">
											Nome Condominio:
										</label>
										<div class="col-sm-10">
											<input type="search" class="form-control" id="inputNomeCondominio" placeholder="Nome Condominio" ng-model="filtro.nomeCondominio">
										</div>
	                                </div>
									<div class="form-group">
										<div class="col-sm-offset-2 col-sm-10">
											<button type="submit" class="btn btn-primary" ng-click="retrieveFilter()">Pesquisar</button>
											<button type="submit" class="btn btn-success" ng-click="create()">Novo Registro</button>
										</div>
									</div>
								</form>
		                    </div>
	                    </div>
					</div>
				</div>
				<div class="col-md-6" style="width: 100%">
		            <div class="panel panel-primary">
						<div class="panel-heading">
							<h3 class="panel-title">Pesquisa .: Resultados</h3>
							<div class="actions pull-right">
								<!-- <i data-fullscreen-widget="" class="fa fa-expand"></i>  -->
	 							<i data-widget-toggle="" class="fa fa-chevron-down"></i>
								<!-- <i data-widget-close="" class="fa fa-times"></i> -->
							</div>
						</div>
	                    <div class="panel-body" style="display: block;">
							<table class="table table-striped">
								<thead>
									<tr>
										<th width="90px">Opções</th>
										<th width="100px">#</th>
										<th>
											<table width="100%">
												<tr>
													<td width="50%">Condominio</td>
													<td width="20%">Titulo</td>
													<td width="14%" align="right">Valor</td>
													<td width="14%" align="center">Status</td>
												</tr>
											</table>
										</th>
									</tr>
								</thead>
								<tbody>
									<tr ng-repeat="unidade in lista">
										<td  width="90px">
											<button class="btn btn-danger btn-sm" ng-click="dlete(unidade)" ng-disabled="{{ unidade.status != 'ABERTO' || unidade.balancete.status != 'ABERTO' }}">
											  <span class="glyphicon glyphicon-remove"></span>
											  Excluir
											</button>
										</td>
										<td width="100px" style="vertical-align: middle;">{{unidade.id}}</td>
										<td style="vertical-align: middle;">
											<table width="100%">
												<tr>
													<td width="50%">{{ unidade.condominio.nome }}</td>
													<td width="20%">{{ unidade.numero }} - {{ unidade.parcela }}/{{ unidade.quantidade }}</td>
													<td width="14%" align="right">R$ {{ unidade.valorTitulo }}</td>
													<td width="14%" align="center">{{ unidade.status }}</td>
												</tr>
											</table>
										</td>
									</tr>
							  </tbody>
							</table>
	                    </div>
					</div>
				</div>
			</section>
		</div>
	</div>
</div>
<!-- LISTAGEM -->

<!-- FORMULARIO  -->
<div ui-view="" class="ng-scope" ng-hide="list"><!-- uiView:  -->
	<div ui-view="" class="ng-scope"><!-- uiView:  -->
		<div class="pageheader ng-scope">
		    <h1>Subgrupo</h1>
		    <div class="breadcrumb-wrapper hidden-xs">
				<span class="label">Você está aqui:</span>
				<ol class="breadcrumb">
		            <li ><a href="#/home">Home</a></li>
		            <li >Administradora</li>
		            <li >Financeiro</li>
		            <li >Cobrança</li>
		            <li class="active">Titulo - Formulário</li>
		            <!-- 
		            <li class="active">Blank Page</li>
		             -->
		        </ol>
			</div>
		</div>
		<div ui-view="" class="ng-scope"><!-- uiView:  -->
		    <section id="main-content" class="animated fadeInRight ng-scope">
				<div class="col-md-6" style="width: 100%">
		            <div class="panel panel-primary">
						<div class="panel-heading">
							<h3 class="panel-title">Formulário .: Dados</h3>
							<div class="actions pull-right">
								<!-- <i data-fullscreen-widget="" class="fa fa-expand"></i>  -->
	 							<i data-widget-toggle="" class="fa fa-chevron-down"></i>
								<!-- <i data-widget-close="" class="fa fa-times"></i> -->
							</div>
						</div>
				  		<form name="userForm" class="form-horizontal" role="form">
							<div class="modal-body">
						        <div class="form-group">
						            <label for="inputId" class="col-sm-2 control-label">Id:</label>
						            <div class="col-sm-10">
						                <input type="text" class="form-control" id="inputId" placeholder="Id" ng-model="unidade.id" disabled="disabled" />
						            </div>
						        </div>
						        <div class="form-group">
						            <label for="inputNumero" class="col-sm-2 control-label">Título:</label>
						            <div class="col-sm-10">
										<!-- Numero, Parcela, Quantidade, Tipo de Titulo -->
							            <div style="width: 15%; padding-left:0px; padding-right:0px;" class="col-sm-10">
						                	<input type="text" class="form-control" id="inputNumero" placeholder="0" ng-model="unidade.numero" />
										</div>
							            <div style="width: 5%; padding-left:0px; padding-right:0px;" class="col-sm-10">
							            	<label for="inputParcela" style="width: 100%" class="col-sm-2 control-label">-</label>
							            </div>
							            <div style="width: 10%; padding-left:0px; padding-right:0px;" class="col-sm-10">
						                	<input type="text" class="form-control" id="inputParcela" placeholder="0" ng-model="unidade.parcela" />
							    		</div>
							            <div style="width: 5%; padding-left:0px; padding-right:0px;" class="col-sm-10">
							            	<label for="inputQuantidade" style="width: 100%" class="col-sm-2 control-label">/</label>
							            </div>
							            <div style="width: 10%; padding-left:0px; padding-right:0px;" class="col-sm-10">
						                	<input type="text" class="form-control" id="inputQuantidade" placeholder="0" ng-model="unidade.quantidade" />
							    		</div>
							            <div style="width: 15%; padding-left:0px; padding-right:0px;" class="col-sm-10">
							            	<label for="inputTipoTitulo" style="width: 100%" class="col-sm-2 control-label">Tipo Título:</label>
							            </div>
							            <div style="width: 40%; padding-left:0px; padding-right:0px;" class="col-sm-10">
							                <select class="form-control" id="inputTipoTitulo" ng-model="unidade.tipoTitulo.id" ng-options="tipoTitulo.id as tipoTitulo.descricao for tipoTitulo in tiposTitulo">
							                	<option value="">Selecione um tipo de título...</option>
							                </select>
							            </div>
						            </div>
						        </div>
						        <div class="form-group">
						            <label for="inputCondominio" class="col-sm-2 control-label">Conominio:</label>
						            <div class="col-sm-10">
										<ui-select theme="bootstrap"
												   ng-model="condominio.selected"
										           ng-disabled="false"
										           reset-search-input="false"
										           on-select="fillSelectsByCondominios()">
											<ui-select-match placeholder="Procure um condominio...">{{$select.selected.nome}}</ui-select-match>
											<ui-select-choices repeat="condominio in condominios track by $index"
										           refresh="retrieveCondominios($select.search)"
										           refresh-delay="0">
												<div ng-bind-html="condominio.nome | highlight: $select.search"></div>
										 	</ui-select-choices>
										</ui-select>					            
						            </div>
						        </div>
						        <div class="form-group">
						            <label for="inputEmissao" class="col-sm-2 control-label">Emissão:</label>
						            <div class="col-sm-10">
							            <div style="width: 25%; padding-left:0px; padding-right:0px;" class="col-sm-10">
								            <p class="input-group">
								              <input type="text" class="form-control data" placeholder="dd/MM/yyyy" datepicker-mode="year" datepicker-popup="dd/MM/yyyy" ng-model="unidade.emissao" is-open="openedEmissao" show-weeks="true" current-text="Hoje" clear-text="Limpar" close-text="Fechar" />
								              <span class="input-group-btn">
								                <button type="button" class="btn btn-default" ng-click="openEmissao($event)"><i class="glyphicon glyphicon-calendar"></i></button>
								              </span>
								            </p>
										</div>
							            <div style="width: 15%; padding-left:0px; padding-right:0px;" class="col-sm-10">
							            	<label for="inputParcela" style="width: 100%" class="col-sm-2 control-label">Vencimento:</label>
							            </div>
							            <div style="width: 25%; padding-left:0px; padding-right:0px;" class="col-sm-10">
								            <p class="input-group">
								              <input type="text" class="form-control data" placeholder="dd/MM/yyyy" datepicker-mode="year" datepicker-popup="dd/MM/yyyy" ng-model="unidade.vencimento" is-open="openedVencto" show-weeks="false" current-text="Hoje" clear-text="Limpar" close-text="Fechar" ng-blur="setVctoUtil()" />
								              <span class="input-group-btn">
												<button type="button" class="btn btn-default" ng-click="openVencto($event)"><i class="glyphicon glyphicon-calendar"></i></button>
								              </span>
								            </p>
										</div>
							            <div style="width: 15%; padding-left:0px; padding-right:0px;" class="col-sm-10">
							            	<label for="inputSaldoTitulo" style="width: 100%" class="col-sm-2 control-label">Vcto Útil:</label>
							            </div>
							            <div style="width: 20%; padding-left:0px; padding-right:0px;" class="col-sm-10">
							            	<label for="inputParcela" style="width: 100%" class="col-sm-2 control-label">{{ unidade.vencimentoutil }}</label>
							            </div>
						            </div>
						        </div>
						        <div class="form-group">
						            <label for="inputValorFatura" class="col-sm-2 control-label">Valor Fatura:</label>
						            <div class="col-sm-10">
										 <!-- Titulo, Saldo  -->
							            <div style="width: 25%; padding-left:0px; padding-right:0px;" class="col-sm-10">
						                	<input type="text" style="text-align: right;" class="form-control currency" id="inputValorFatura" placeholder="0" ng-model="unidade.valorFatura" />
										</div>
							            <div style="width: 15%; padding-left:0px; padding-right:0px;" class="col-sm-10">
							            	<label for="inputValorTitulo" style="width: 100%" class="col-sm-2 control-label">Valor Título:</label>
							            </div>
							            <div style="width: 25%; padding-left:0px; padding-right:0px;" class="col-sm-10" >
						                	<input type="text" style="text-align: right;" class="form-control currency" id="inputValorTitulo" placeholder="0" ng-model="unidade.valorTitulo" ng-blur="setSaldo()" />
							    		</div>
							            <div style="width: 15%; padding-left:0px; padding-right:0px;" class="col-sm-10">
							            	<label for="inputSaldoTitulo" style="width: 100%" class="col-sm-2 control-label">Saldo Título:</label>
							            </div>
							            <div style="width: 20%; padding-left:0px; padding-right:0px;" class="col-sm-10">
							            	<label for="inputSaldoTitulo" style="width: 100%" class="col-sm-2 control-label">R$ {{ unidade.saldotitulo }}</label>
							    		</div>
						            </div>
						        </div>
						        <div class="form-group">
						            <label for="inputHistorico" class="col-sm-2 control-label">Histórico:</label>
						            <div class="col-sm-10">
							            <div style="width: 55%; padding-left:0px; padding-right:0px;" class="col-sm-10">
							                <select class="form-control" id="inputHistorico" ng-model="unidade.historico.id" ng-options="historico.id as historico.descricao for historico in historicos">
							                	<option value="">Selecione um histórico...</option>
							                </select>
							            </div>
							            <div style="width: 15%; padding-left:0px; padding-right:0px;" class="col-sm-10">
							            	<label for="inputHistórico" style="width: 100%" class="col-sm-2 control-label">Balancete:</label>
							            </div>
							            <div style="width: 30%; padding-left:0px; padding-right:0px;" class="col-sm-10">
							                <select class="form-control" id="inputCompentencia" ng-model="unidade.balancete.id" ng-options="balancete.id as balancete.dataVencimento for balancete in balancetes">
							                	<option value="">Selecione um balancete...</option>
							                </select>
							            </div>
							    	</div>
						        </div>
						        <div class="form-group">
						            <label for="inputFornecedor" class="col-sm-2 control-label">Fornecedor:</label>
						            <div class="col-sm-10">
						            	<div style="width: 55%; padding-left:0px; padding-right:0px;" class="col-sm-10">
											<ui-select theme="bootstrap"
													   ng-model="fornecedor.selected"
											           ng-disabled="false"
											           reset-search-input="false">
												<ui-select-match placeholder="Procure um fornecedor...">{{$select.selected.fantasia}}</ui-select-match>
												<ui-select-choices repeat="fornecedor in fornecedores track by $index"
											           refresh="retrieveFornecedores($select.search)"
											           refresh-delay="0">
													<div ng-bind-html="fornecedor.fantasia | highlight: $select.search"></div>
											 	</ui-select-choices>
											</ui-select>					            
							            </div>
							            <div style="width: 15%; padding-left:0px; padding-right:0px;" class="col-sm-10">
							            	<label for="inputHistórico" style="width: 100%" class="col-sm-2 control-label">Imóvel:</label>
							            </div>
							            <div style="width: 30%; padding-left:0px; padding-right:0px;" class="col-sm-10">
							                <select class="form-control" id="inputImovel" ng-model="unidade.imovel.id" ng-options="imovel.id as imovel.numero for imovel in imoveis">
							                	<option value="">Selecione um imóvel...</option>
							                </select>
							            </div>
						            </div>
						        </div>
						    </div>
							<div class="modal-footer ng-scope">
							    <button class="btn btn-default" ng-click="cancel()">Voltar</button>
							    <button class="btn btn-primary" ng-click="save(userForm.$valid)" type="submit">Salvar</button>
							</div>
					    </form>
					</div>
				</div>
				<script>
				    $(document).ready(function() {
				        main.formMask();
				    });
				</script>	
			</section>
		</div>
	</div>
</div>
<!-- FORMULARIO -->
